// 开启数据响应服务器，作为终端服务器使用
const http = require("http");
const qs = require("querystring");

// const str = 'id=3&city=北京&url=https://www.baidu.com';
// console.log(qs.escape(str));

// const str = 'id%3D3%26city%3D%E5%8C%97%E4%BA%AC%26url%3Dhttps%3A%2F%2Fwww.baidu.com';
// console.log(qs.unescape(str));

http.createServer((req,res)=>{
    console.log(req.url);
    console.log(qs.unescape(req.url));
    res.write("");
    res.end();
}).listen(3000,()=>{
    console.log("服务器开启成功")
});
